﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="ProductPicList.aspx.cs" Inherits="Maticsoft.Web.Admin.Shopping.ProductPicList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<script type="text/javascript">
    $(function () {
        $("#chk_all").click(function () {
            $("input[name=chk_list]").each(function () {
                $(this).attr("checked", true);
            })
        });
        $("#chk_no").click(function () {
            $("input[name=chk_list]").each(function () {
                $(this).attr("checked", false);
            })
        });
        $(".status").each(function () {
            if ($(this).text() == "已审") {
                $(this).css("color", "red");
            }
        })
    })
    function Del(flag) {
        var ids = "";
        $("#lists input:checkbox").each(function () {
            if ($(this).attr("checked") == true) {
                if (ids.length > 0) {
                    ids += ",";
                }
                ids += $(this).val();
            }
        })
        if (flag == "2") {
            if (ids.length > 0) {
                $("#ctl00_ContentPlaceHolder1_txtIds").val(ids);
                return true;
            }
            else {
                alert("请选择要审核记录");
                return false;
            }
        }
        if (flag == "1") {
            if (ids.length > 0) {
                if (confirm("确认删除？")) {
                    $("#ContentPlaceHolder1_txtIds").val(ids);
                    return true;
                }
                else {
                    return false;
                }
            }
            else {
                alert("请选择要删除记录");
                return false;
            }
        }
    }
    </script>
    <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#111111"
        style="border-collapse: collapse">
        <tr>
            <td width="100%" height="20" valign="top">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td height="30">
                            <img height="14" src="../images/book1.gif" width="20">&nbsp;产品管理&nbsp;&gt;&gt;&nbsp;产品列表&nbsp;&gt;&gt;&nbsp;产品图片
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td width="100%" height="1" background="../images/sp_bg.gif">
            </td>
        </tr>
    </table>
    <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
            <td height="10">
            </td>
        </tr>
    </table>
    <!--  快速转换位置按钮  -->
    <table width="98%" border="0" cellpadding="0" cellspacing="1" bgcolor="#ccd9b9" align="center">
        <tr>
            <td height="26" background="../images/newlinebg3.gif">
                <table width="98%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td align="left">
                            &nbsp;<input type='button' class="coolbg np" onclick="location='ProductPicEdit.aspx?act=add&id=<%=Request.QueryString["id"] %>';"
                                value='添加图片' />&nbsp;<input type='button' class="coolbg np" onclick="location='ProductList.aspx';"
                                value='返回产品列表' />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <!--  内容列表   -->
    <table width="98%" border="0" cellpadding="2" cellspacing="1" bgcolor="#CFCFCF" align="center"
        style="margin-top: 8px" id="lists">
        <tr bgcolor="#E7E7E7">
            <td height="28" colspan="4" background="../images/tbg.gif" style="padding-left: 10px;">
                ◆ 产品管理 &gt; 产品列表 &gt; 产品图片
            </td>
        </tr>
        <tr align="center" bgcolor="#FBFCE2">
            <td width="4%" height="25">
                选择
            </td>
            <td width="6%">
                ID
            </td>
            <td>
                图片
            </td>
            <td>
                操作
            </td>
        </tr>
        <asp:Repeater ID="Repeater1" runat="server">
            <ItemTemplate>
                <tr align='center' bgcolor="#FFFFFF" onmousemove="javascript:this.bgColor='#FCFDEE';"
                    onmouseout="javascript:this.bgColor='#FFFFFF';">
                    <td height="26">
                        <input name="chk_list" type="checkbox" id="chk_list" class="np" value="<%#Eval("ProductPicId") %>" />
                    </td>
                    <td>
                        <%#Eval("ProductPicId")%>
                    </td>
                    <td>
                        <img src="../../uploadpic/<%#Eval("url").ToString().Split('.')[0] + "_s." + Eval("url").ToString().Split('.')[1]%>" />
                    </td>
                    <td>
                        <a href="ProductPicEdit.aspx?id=<%#Eval("ProductId")%>&picid=<%#Eval("ProductPicId")%>">修改</a>
                    </td>
                </tr>
            </ItemTemplate>
        </asp:Repeater>
        <tr bgcolor="#ffffff">
            <td height="36" colspan="4">
                &nbsp; <a href="javascript:void(0);" id="chk_all" class="coolbg">全选</a> <a href="javascript:void(0);"
                    class="coolbg" id="chk_no">取消</a>
                <asp:LinkButton ID="LinkButton1" runat="server" class="coolbg" OnClick="LinkButton1_Click"
                    OnClientClick="return Del('1');">删除</asp:LinkButton><input id="txtIds" type="text"
                        runat="server" style="display: none" />
            </td>
        </tr>
    </table>
</asp:Content>
